﻿using System;
using System.Collections.Generic;
using System.Text;

namespace TCCHWLib.Commands
{
    public class NotEqualCommand:ICommand
    {

        public NotEqualCommand(object parameter1, ParameterType paramterType1, object parameter2, ParameterType paramterType2)
        {
            m_Operand1 = parameter1;
            m_Operand2 = parameter2;
            m_Type1 = paramterType1;
            m_Type2 = paramterType2;
            m_ExOperand1 = parameter1;
            m_ExOperand2 = parameter2;
            m_ExType1 = paramterType1;
            m_ExType2 = paramterType2;
            this.Value = false;
        }

        public override object Execute(Processor processor)
        {
            double op1 = Convert.ToDouble(m_ExOperand1);
            double op2 = Convert.ToDouble(m_ExOperand2);
            if (op1 != op2)
                m_Value = 0;
            else
                m_Value = 1;
            return this.Value;
        }

        public override string ToString()
        {
            return base.ToString() + String.Format("> {0}, {1} , = >> {2}", m_Operand1, m_Operand2, this.Value);

        }
    }
}
